<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>问答列表</title>
<link rel="stylesheet" type="text/css" href="static/style/base.css">
<script language="javascript" src="static/js/dedeajax2.js"></script>
<script language="javascript" src="static/js/jquery-1.4.min.js"></script>
<script language="javascript" src="static/js/ieemu.js"></script>
<script language="javascript" src="static/js/context_menu.js"></script>
<script language="javascript" src="static/js/main.js"></script>
<script language="javascript" src="static/js/list.js"></script>
<script type="text/javascript">
function isDelete(id){
  var t = confirm("确认删除该联系方式?");
  if(t){
    location.href = "?wenda&ct=contact&ac=delete&id=" + id;
  }
}
function add_contact(){
    // alert("<tr align=\"left\" bgcolor=\"#FFFFFF\" height=\"26\" align=\"center\" onMouseMove=\"javascript:this.bgColor=\'#FCFDEE\';\" onMouseOut=\"javascript:this.bgColor=\'#FFFFFF\';\"><td width=\"40%\"><input type=\"text\" name=\"key[]\" style=\"width:300px;\" value=\"\" /> </td><td width=\"50%\"><input type=\"text\"  name=\"value[]\" style=\"width:400px; \" value=\"\"/></td><td width=\"10%\">\&nbsp;</td></tr>");
        // alert("<tr><td>1</td><td>2</td><td>3</td> <tr>");
    $("#mytable").append("<tr align=\"left\" bgcolor=\"#FFFFFF\" height=\"26\" align=\"center\" onMouseMove=\"javascript:this.bgColor=\'#FCFDEE\';\" onMouseOut=\"javascript:this.bgColor=\'#FFFFFF\';\"><td width=\"40%\"><input type=\"text\" name=\"key[]\" style=\"width:300px;\" value=\"\" /> </td><td width=\"50%\"><input type=\"text\"  name=\"value[]\" style=\"width:400px; \" value=\"\"/></td><td width=\"10%\">\&nbsp;</td></tr>");
}
</script>
<script type="text/javascript">
/*  $(function(){
      alert("asdf");
  });*/
</script>
</head>
<body leftmargin="8" topmargin="8" background='static/images/allbg.gif' onLoad="ContextMenu.intializeContextMenu()">

<!--  内容列表   -->
<form name="form2" action="?ct=contact&ac=edit" method="post">
<table id="mytable" width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center" style="margin-top:8px">
<tr bgcolor="#E7E7E7" >
    <td height="28" colspan="3" background="static/images/tbg.gif" style="padding-left:10px;">
    ◆ 联系方式
    </td>
</tr>
<?php $data = $GLOBALS['_vars']['data']; ?>
<?php
if(!empty($data)){
foreach ($data as $key => $value) {
    ?>
        <tr align="left" bgcolor="#FFFFFF" height="26" align="center" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
            <td width="40%"><input type="text" name="key[]" style="width:300px;" value="<?php echo $value['key'] ?> " /> </td>
            <td width="50%"><input type="text"  name="value[]" style="width:400px; " value="<?php echo $value['value'] ?> "/></td>
            <td width="10%"><a href="#" onclick="isDelete(<?php echo $value['id']; ?>);return false;">移除</a></td>
        </tr>
    <?php
} }else{
?>
        <tr align="left" bgcolor="#FFFFFF" height="26" align="center" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
            <td width="40%"><input type="text" name="key[]" style="width:300px;" value="" /> </td>
            <td width="50%"><input type="text"  name="value[]" style="width:400px; " value=""/></td>
            <td width="10%">&nbsp;</td>
        </tr>
<?php
    }?>
    </table>
    <table  width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center">
    <tr>
        <td  align="right" colspan="3" height="26" style="padding-left: 35%" bgcolor="#FFFFFF" >
                <a href="#" onclick="add_contact();return false;">添加一项联系方式</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        </td>
    </tr>
    <tr>
        <td  colspan="3" height="40" style="padding-left: 35%" bgcolor="#FFFFFF" >
                <input type="submit" value="提交" />
        </td>
    </tr>
</table>
</form>
</table>



</body>
</html>